package com.wyzz.hr.pojo.base;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Set;
import java.util.TreeSet;

import com.wyzz.hr.pojo.Overtimerequest;
import com.wyzz.hr.pojo.Overtimetype;

public abstract class BaseOvertimetype implements Serializable {

	public BaseOvertimetype() {
		hashCode = 0x80000000;
		initialize();
	}

	public BaseOvertimetype(String otNo) {
		hashCode = 0x80000000;
		setOtNo(otNo);
		initialize();
	}

	public BaseOvertimetype(String otNo, String otName, String otDesc,
			BigDecimal otHourRate, Integer otSortId) {
		hashCode = 0x80000000;
		setOtNo(otNo);
		setOtName(otName);
		setOtDesc(otDesc);
		setOtHourRate(otHourRate);
		setOtSortId(otSortId);
		initialize();
	}

	protected void initialize() {
	}

	public String getOtNo() {
		return otNo;
	}

	public void setOtNo(String otNo) {
		this.otNo = otNo;
		hashCode = 0x80000000;
	}

	public String getOtName() {
		return otName;
	}

	public void setOtName(String otName) {
		this.otName = otName;
	}

	public String getOtDesc() {
		return otDesc;
	}

	public void setOtDesc(String otDesc) {
		this.otDesc = otDesc;
	}

	public Integer getOtOverLimit() {
		return otOverLimit;
	}

	public void setOtOverLimit(Integer otOverLimit) {
		this.otOverLimit = otOverLimit;
	}

	public BigDecimal getOtHourRate() {
		return otHourRate;
	}

	public void setOtHourRate(BigDecimal otHourRate) {
		this.otHourRate = otHourRate;
	}

	public Integer getOtSortId() {
		return otSortId;
	}

	public void setOtSortId(Integer otSortId) {
		this.otSortId = otSortId;
	}

	public Set getOvertimerequests() {
		return overtimerequests;
	}

	public void setOvertimerequests(Set overtimerequests) {
		this.overtimerequests = overtimerequests;
	}

	public void addToOvertimerequests(Overtimerequest overtimerequest) {
		if (null == getOvertimerequests())
			setOvertimerequests(new TreeSet());
		getOvertimerequests().add(overtimerequest);
	}

	public boolean equals(Object obj) {
		if (null == obj)
			return false;
		if (!(obj instanceof Overtimetype))
			return false;
		Overtimetype overtimetype = (Overtimetype) obj;
		if (null == getOtNo() || null == overtimetype.getOtNo())
			return false;
		else
			return getOtNo().equals(overtimetype.getOtNo());
	}

	public int hashCode() {
		if (0x80000000 == hashCode) {
			if (null == getOtNo())
				return super.hashCode();
			String hashStr = (new StringBuilder()).append(getClass().getName())
					.append(":").append(getOtNo().hashCode()).toString();
			hashCode = hashStr.hashCode();
		}
		return hashCode;
	}

	public String toString() {
		return super.toString();
	}

	public static String REF = "Overtimetype";
	public static String PROP_OT_HOUR_RATE = "otHourRate";
	public static String PROP_OT_OVER_LIMIT = "otOverLimit";
	public static String PROP_OT_NO = "otNo";
	public static String PROP_OT_SORT_ID = "otSortId";
	public static String PROP_OT_DESC = "otDesc";
	public static String PROP_OT_NAME = "otName";
	private int hashCode;
	private String otNo;
	private String otName;
	private String otDesc;
	private Integer otOverLimit;
	private BigDecimal otHourRate;
	private Integer otSortId;
	private Set overtimerequests;

}
